import http from "@/utils/http";

// 仓租配置接口

// 分页查询仓租配置列表数据
export function ware_searchTabList(params) {
  return http.post("/sys-store-house-charge-rule/select/Page/item", params);
}
// 确认添加仓租配置
export function ware_addWareRules(params) {
  return http.post("/sys-store-house-charge-rule/add/item", params);
}
// 修改仓租配置
export function ware_editWareRules(ruleId, params) {
  return http.post("/sys-store-house-charge-rule/edit/item/" + ruleId, params);
}

//收费规则配置

// 分页查询列表数据
export function config_searchTabList(businessType, params) {
  return http.post(
    "/sys-charging-scheme-rule-fk/select/Page/item/" + businessType,
    params
  );
}

//清关修改
// 修改
export function liqui_editWareRules(id, params) {
  return http.post("/sys-customs-clearance-rule/edit/item/" + id, params);
}

// 确认添加
export function liqui_addWareRules(params) {
  return http.post("/sys-customs-clearance-rule/add/item", params);
}

//入库卸货规则

// 确认添加
export function unload_addWareRules(params) {
  return http.post("/sys-discharge-cargo-rule/add/item", params);
}
// 修改
export function unload_editWareRules(id, params) {
  return http.post("/sys-discharge-cargo-rule/edit/item/" + id, params);
}

//上架规则

// 确认添加
export function putaway_addWareRules(params) {
  return http.post("/sys-upper-frame-rule/add/item", params);
}
// 修改
export function putaway_editWareRules(id, params) {
  return http.post("/sys-upper-frame-rule/edit/item/" + id, params);
}

//仓库增值

// 确认添加
export function appreciation_addWareRules(params) {
  return http.post("/sys-store-house-operation-rule/add/item", params);
}
// 修改
export function appreciation_editWareRules(id, params) {
  return http.post("/sys-store-house-operation-rule/edit/item/" + id, params);
}

//订单处理

// 确认添加
export function orderhandle_addWareRules(params) {
  return http.post("/sys-order-handle-rule/add/item", params);
}
// 修改
export function orderhandle_editWareRules(id, params) {
  return http.post("/sys-order-handle-rule/edit/item/" + id, params);
}

//复合订单

// 确认添加
export function composite_addWareRules(params) {
  return http.post("/sys-composite-pack-rule/add/item", params);
}
// 修改
export function composite_editWareRules(id, params) {
  return http.post("/sys-composite-pack-rule/edit/item/" + id, params);
}

//转运操作订单
// 确认添加
export function transfer_addWareRules(params) {
  return http.post("/sys-transport-operation-rule/add/item", params);
}
//修改
export function transfer_editWareRules(id, params) {
  return http.post("/sys-transport-operation-rule/edit/item/" + id, params);
}

//退件接收订单
// 确认添加
export function receive_addWareRules(params) {
  return http.post("/sys-return-charge-rule/add/item", params);
}
//修改
export function receive_editWareRules(id, params) {
  return http.post("/sys-return-charge-rule/edit/item/" + id, params);
}

//退件处理订单
// 确认添加
export function dispose_addWareRules(params) {
  return http.post("/sys-return-handle-rule/add/item", params);
}
//修改
export function dispose_editWareRules(id, params) {
  return http.post("/sys-return-handle-rule/edit/item/" + id, params);
}

//退件销毁订单
// 确认添加
export function destroy_addWareRules(params) {
  return http.post("/sys-return-destroy-rule/add/item", params);
}
//修改
export function destroy_editWareRules(id, params) {
  return http.post("/sys-return-destroy-rule/edit/item/" + id, params);
}

//运费配置接口

//查物流商树
export function freight_logiTree(params) {
  return http.post("/sys-service-item-freight-scheme/select/tree", params);
}
//新增方案
export function freight_addScheme(params) {
  return http.post("/sys-service-item-freight-scheme/save/item", params);
}

//根据方案查表格
export function freight_searchTabList(serviceItemId, freightSchemeId, params) {
  return http.post(
    "/sys-service-item-freight-scheme-rule/select/" +
      serviceItemId +
      "/" +
      freightSchemeId,
    params
  );
}

//确认添加方案
export function freight_schemeSureAdd(serviceItemId, freightSchemeId, params) {
  return http.post(
    "/sys-service-item-freight-scheme-rule/saveForUpdate/" +
      serviceItemId +
      "/" +
      freightSchemeId,
    params
  );
}
//删除方案
export function freight_deleteItem(
  serviceItemId,
  freightSchemeId,
  sysServiceItemFreightSchemeRuleId
) {
  return http.post(
    "/sys-service-item-freight-scheme-rule/remove/" +
      serviceItemId +
      "/" +
      freightSchemeId +
      "/" +
      sysServiceItemFreightSchemeRuleId
  );
}
//是否启用方案
export function freight_editItem(sysServiceItemFreightSchemeRuleId, params) {
  return http.post(
    "/sys-service-item-freight-scheme/edit/one/" +
      sysServiceItemFreightSchemeRuleId +
      "/" +
      params
  );
}

//
//费用应用

//查询表格数据
export function cost_searchTabList(params) {
  return http.post("/sys-charging-scheme/select/page/list", params);
}
//确认添加方案规则
export function cost_addSheme(params) {
  return http.post("/sys-charging-scheme/save/item", params);
}
//修改方案规则
export function cost_editSheme(sysChargingSchemeId, params) {
  return http.post(
    "/sys-charging-scheme/edit/item/" + sysChargingSchemeId,
    params
  );
}
//查询单条方案
export function cost_searchOneSheme(schemeId) {
  return http.post("/sys-charging-scheme/select/one/" + schemeId);
}

//关联规则查询
export function cost_searchRules(sysChargingSchemeId, businessType, params) {
  return http.post(
    "/sys-charging-scheme-rule-fk/select/page/List/" +
      sysChargingSchemeId +
      "/" +
      businessType,
    params
  );
}
//添加或修改关联规则查询
export function cost_addOrEditRules(sysChargingSchemeId, businessType, params) {
  return http.post(
    "/sys-charging-scheme-rule-fk/edit/save/Item/" +
      sysChargingSchemeId +
      "/" +
      businessType,
    params
  );
}
